package com.symc.his.api.impl.utils;

/**
 * @Description:
 * @CreateTime: 2023/4/7 13:46
 * @Version:
 * @Since: 1.8
 * @Author: 辛凤文 forward.seen@foxmail.com
 */
public class SqlUtil {

    /**
     * 计算分页的起始记录数
     *
     * @param currentPage 当前页
     * @param pageSize 单页记录数
     * @return
     */
    public static Long calcStartRecordByCurrentPage(Long currentPage,Long pageSize){
        if (currentPage <= 1L) {
            return 0L;
        }
        return Math.max((currentPage - 1) * pageSize, 0L);
    }
}